home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7558 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.6 KB  |  61 lines

  1. Path: sun001.spd.dsccc.com!spd!jmccarty
  2. From: jmccarty@spd.dsccc.com (Mike McCarty)
  3. Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
  4. Subject: Re: Access carry flag from C
  5. Date: 23 Feb 1996 23:55:41 GMT
  6. Organization: DSC Communications Corporation, Plano, Texas USA
  7. Message-ID: <4glk5t$avt@sun001.spd.dsccc.com>
  8. References: <Dn1C9z.DGv.0.net@indra.com> <312AFACE.41C6@bazis.nl> <TANMOY.96Feb21081640@qcd.lanl.gov> <312D8414.167E@bazis.nl>
  9. NNTP-Posting-Host: aplo139.spd.dsccc.com
  10.  
  11. In article <312D8414.167E@bazis.nl>, Franz Korntner  <fkorntne@bazis.nl> wrote:
  12. )Tanmoy Bhattacharya wrote:
  13. )> 
  14. )> In article <312AFACE.41C6@bazis.nl> Franz Korntner <fkorntne@bazis.nl>
  15. )> writes:
  16. )> <snip>
  17. )>    32 bit numbers. According to the (X3J11 / ANSI) standard, the constant
  18. )>    INT_MAX (and in this case most limits in limits.h) denotes the minimal
  19. )>    limit. It is possible that the physical limit is much higher (or lower
  20. )>    in the case of negative values). As I am only interested in the physical
  21. )>    limit, the value INT_MAX has no meaning. Only the compiler is fully aware
  22. )>    of these limits (and not a header file!) and what I really miss in the
  23. )>    standard and/or implementation is a inline function 'maxlimitof(int)',
  24. )>    analogical to 'sizeof(int)'.
  25. )> 
  26. )> Please quote the standard. I find no discussion of this in my copy;
  27. )> and I suspect it is incorrect.
  28. )
  29. )I only have a copy of the Rationale at this moment, and it is also mentioned
  30. )on page 17, Environmental limits.
  31. )
  32. )2.2.4.2.1 Sizes of integral types <limits.h>. Such a large body of C code
  33. )has been developed for the 8-bit byte machines that the integer sizes in
  34. )such environments must be considered normative. The prescribed limits are
  35. )minima; an implementation on a machine with 9-bit bytes can be conforming,
  36. )as can an implementation that defines int to be the same width as long.
  37. )page 17.
  38.  
  39. ISO Standard
  40.  
  41.     5.2.4.2.1 Sizes of integral types <limits.h>
  42.     
  43.       The values given below shall be replaced by constant expressions
  44.     suitable for use in #if preprocessing directives. Morever, except
  45.     for CHAR_BIT and MB_LEN_MAX, the following shall be replaced by
  46.     expressions that have the same type as would an expression that
  47.     is an object of the corresponding type converted according to the
  48.     integral promotions. Their implementation-defined values shall be
  49.     equal or greater in magnitude (absolute value) to those shown, with
  50.     the same sign.
  51.  
  52. Is that good enough? They may be larger.
  53.  
  54. Mike
  55.  
  56.  
  57. ----
  58. char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
  59.  
  60. I don't speak for DSC.         <- They make me say that.
  61.